package com.laconic.vbenadmin.config;

import com.laconic.vbenadmin.interceptor.WebInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author JiangLiu
 * @Date 2025/6/18 09:48
 **/
@Configuration
public class WebConfigurer implements WebMvcConfigurer {

    @Autowired
    WebInterceptor webInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(webInterceptor)
                .addPathPatterns("/**");

        // 哪些请求不过经过拦截器
//                .excludePathPatterns("");
    }
}
